<?php

/**
 * Validator for {@link Category}.
 * @see CategoryMapper
 */
final class CategoryValidator {

    private function __construct() {
        
    }

    /**
     * Validate the given {@link Todo} instance.
     * @param Todo $todo {@link Todo} instance to be validated
     * @return array array of {@link Error} s
     */
    public static function validate(Category $category) {
        $errors = array();
        if (!trim($category->getname())) {
            $errors[] = new Error('name', 'Name cannot be empty.');
        }
        return $errors;
    }

}

?>
